<%@page import="com.kensure.shike.constant.BusiConstant"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>订单确认</title>
	<meta http-equiv="Content-Type" content="textml; charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<link href="<%=BusiConstant.context%>/page1/webview/css/index.css" rel="stylesheet" type="text/css" media="all" />
	<script type="text/javascript" src="<%=BusiConstant.context%>/common/js/jquery.min.js"></script>
	<script type="text/javascript" src="<%=BusiConstant.context%>/common/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="<%=BusiConstant.context%>/common/base.js?ver=<%=BusiConstant.version%>"></script>
	<script type="text/javascript" src="<%=BusiConstant.context%>/common/http.js?ver=<%=BusiConstant.version%>"></script>
	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.0.js"></script>
	<style>
	button {
		width:200px;
		height:50px;
		display: block;
		margin-left: auto;
		margin-right: auto;
		padding-left: 14px;
		padding-right: 14px;
		box-sizing: border-box;
		font-size: 18px;
		text-align: center;
		text-decoration: none;
		line-height: 2.55555556;
		border-radius: 5px;
		-webkit-tap-highlight-color: transparent;
		overflow: hidden;
		color: #fff;
		background-color: #CE3C39;
	}
	
	</style>
</head>
<body class="loading">
	<div class="wrapper">	
	   	<div class="whole" id="list">
	   		
	   	</div>    
	   
	</div>
		
</body>

<script>
var basecontext = '<%=BusiConstant.context%>';
var id = getQueryVariable("id");
function getList(){
	var url = getbaseurl("/order/detail.do");
	var data = {id:id};
	postdo(url, data, function(data){
		var row = data.resultData.row;
		showtable(row);
	}, null, null);
}
getList();

function showtable(row){
	var html = '<div class="ations">'
	+'<strong>'
	+'<span>订单编号：'+row.code+'<br>付款时间：'+row.createdTimeStr+'</span>'
	+'<em>'+row.statusStr+'</em>'
	+'</strong>'
	+'<ul>';	
	var list = row.orderList;
	for(var i=0;i<list.length;i++){
		var order = list[i];
		html += '<div class="biaoti">'
			+'<img src="'+order.baobei.picurl+'">'
			+'<span>'+order.title+'</span>'
			+'<div class="cl">规格：<a>'+order.yanse +'</a></div>'
			+'<p>使用说明：'+order.content+'</p>'
			+'</div>';
	}	
	html += '</ul>';
	if(row.status == 1){
		html += '<button onclick="queren()">确认使用</button>';
	}
	html += '</div><br><br><br>';
	$("#list").html(html);
}

function queren(){
	var url = getbaseurl("/order/shouhuo.do");
	var data = {id:id};
	postdo(url, data, function(data){
		alert("成功使用");
		getList();
	}, null, null);
}

</script>

</html>
